import request from '@/utils/request';

import { AxiosPromise } from 'axios';

// 获取消息列表
export function getMessageList(params: any): AxiosPromise<any> {
  return request({
    url: 'knowledge/message/getMessageByUser',
    method: 'get',
    params,
  });
}

// 点击消息设置已读
export function readMessage(data: any): AxiosPromise<any> {
  return request({
    url: 'knowledge/message/readMessage',
    method: 'post',
    data:data
  });
}

// 全部设置已读
export function readAllMessage(data: any): AxiosPromise<any> {
  return request({
    url: 'knowledge/message/readMessageAll',
    method: 'post',
    data:data
  });
}

// 删除消息
export function deleteMessage(ids:any): AxiosPromise<any> {
  return request({
    url: `knowledge/message/${ids}`,
    method: 'delete',
  });
}